﻿#region Using
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;

// MVP
using Mvp.Library;
using Mvp.Library.Entities.Context;
#endregion // System

namespace Mvp.Library.Test.Data
{
    internal class DbContextInitializer : DropCreateDatabaseAlways<MvpContext>
    {
        protected override void Seed(MvpContext context)
        {
            //base.Seed(context);

            Entities.Configuration config = context.Configurations.Add(new Entities.Configuration()
            {
                Name = "Test",
                Description = "Test Desc",
                IsActive = true
            });

            config.AddSetting(new Entities.ConfigurationSetting()
                {
                    Name = "TestValue_Int32100",
                    Type = "System.Int32",
                    Value = "100",
                    IsActive = true,
                });

            config.AddSetting(new Entities.ConfigurationSetting()
            {
                Name = "TestValue_StringTest",
                Type = "System.String",
                Value = "Test",
                IsActive = true,
            });

            context.SaveChanges();
        }// of Seed(MvpContext)
    }// of class DbContextInitializer
}// of namespace Mvp.Library.Test.Data